<?php
/**
 * View a list of items
 *
 * @package Elgg
 *
 * @uses $vars['items']       Array of ElggEntity or ElggAnnotation objects
 * @uses $vars['offset']      Index of the first list item in complete list
 * @uses $vars['limit']       Number of items per page. Only used as input to pagination.
 * @uses $vars['count']       Number of items in the complete list
 * @uses $vars['base_url']    Base URL of list (optional)
 * @uses $vars['pagination']  Show pagination? (default: true)
 * @uses $vars['position']    Position of the pagination: before, after, or both
 * @uses $vars['full_view']   Show the full view of the items (default: false)
 * @uses $vars['list_class']  Additional CSS class for the <ul> element
 * @uses $vars['item_class']  Additional CSS class for the <li> elements
 */
$headers = $vars['headers'];

$list_class = 'elgg_header-list';
if (isset($vars['header_list_class'])) {
	$list_class = "$list_class {$vars['header_list_class']}";
}

$html = "";

if (is_array($headers) && count($headers) > 0) {
	$html .= "<p class=\"$list_class\" id='title-header'>";
	foreach ($headers as $item) {
		$item_value = $item['text'];
		$item_class = $item['class'];
		if ($item_value) {
			$html .= "<span class=\"$item_class\">$item_value</span>";
		}
	}
	$html .= '</p>';
}

echo $html;